<header class="topbar">

    <nav class="navbar top-navbar navbar-expand-md navbar-light">
        <!-- ============================================================== -->
        <!-- Logo -->
        <!-- ============================================================== -->
        <div class="navbar-header">
            <a class="navbar-brand" href="http://hrcc8.com/admin">
                <!-- Logo icon --><b>
                    <!--You can put here icon as well // <i class="wi wi-sunset"></i> //-->
                    <!-- Dark Logo icon -->
                    <img src="{{ asset('/assets/images/logo-icon.png') }}" alt="homepage" class="dark-logo" style="width:40px;"/>
                    <!-- Light Logo icon -->
                </b>
                <b><h4 style="color: #FFFFFF;padding-left:15px;">
                    @if(auth('admin')->user()->type != 1)
                        @if(auth('admin')->user()->type == 2 && auth('admin')->user()->parent_id == 0)
                            云柜平台
                        @else 
                            {{ optional(auth('admin')->user()->parent)->name }}
                        @endif
                    @else
                     云柜平台
                    @endif
                </h4></b>
        </div>
        <!-- ============================================================== -->
        <!-- End Logo -->
        <!-- ============================================================== -->
        <div class="navbar-collapse">
            <!-- ============================================================== -->
            <!-- toggle and nav items -->
            <!-- ============================================================== -->
            <ul class="navbar-nav mr-auto">
                <!-- This is  -->
                <li class="nav-item"> <a class="nav-link nav-toggler hidden-md-up waves-effect waves-dark" href="javascript:void(0)"><i class="ti-menu"></i></a> </li>
                <li class="nav-item"> <a class="nav-link sidebartoggler hidden-sm-down waves-effect waves-dark" href="javascript:void(0)"><i class="ti-menu"></i></a> </li>
                
            </ul>
            <!-- ============================================================== -->
            <!-- User profile and search -->
            <!-- ============================================================== -->
            <ul class="navbar-nav my-lg-0">
                {{-- <li class="nav-item dropdown">
                    </li>
                <li class="nav-item dropdown"><a nav-link dropdown-toggle waves-effect waves-dark href="{{ route('admin.profile') }}" target="main-body"><i class="ti-user"></i> 个人中心</a></li> --}}
                <!-- ============================================================== -->
                <!-- Search -->
                <!-- ============================================================== -->
                {{-- <li class="nav-item hidden-xs-down search-box"> <a class="nav-link hidden-sm-down waves-effect waves-dark" href="javascript:void(0)"><i class="ti-search"></i></a>
                    <form class="app-search">
                        <input type="text" class="form-control" placeholder="Search & enter"> <a class="srh-btn"><i class="ti-close"></i></a> </form>
                </li> --}}
                <!-- ============================================================== -->
                <!-- Comment -->
                <!-- ============================================================== -->
                <li class="nav-item dropdown">
                    
                    <a class="nav-link dropdown-toggle waves-effect waves-dark" @click="notices" href="" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        <el-badge :value="notice_total" class="item">
                          <el-button>系统公告</el-button>
                        </el-badge>
                    </a>
                    <div class="dropdown-menu dropdown-menu-right mailbox animated bounceInDown">
                        <ul>
                            <li>
                                <div class="drop-title">公告消息</div>
                            </li>
                            <li>
                                <div class="message-center" style="height:auto">
                                    <!-- Message -->
                                    <a href="javascript:;" @click="details(item)" v-for="item in notice_lists" :key="item.id">
                                        <div class="btn btn-danger btn-circle"><i class="mdi mdi-email"></i></div>
                                        <div class="mail-contnet">
                                            <h5>@{{item.notice.title}}</h5> <span class="mail-desc">@{{item.notice.content}}</span> <span class="time">@{{ item.created_at}}</span> </div>
                                    </a>                                    
                                </div>
                            </li>
                        </ul>
                    </div>
                </li>
                <!-- ============================================================== -->
                <!-- End Comment -->
                <!-- ============================================================== -->
                <!-- ============================================================== -->
                <!-- Messages -->
                <!-- ============================================================== -->
                {{-- <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle waves-effect waves-dark" href="" id="2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="mdi mdi-email"></i>
                        <div class="notify"> <span class="heartbit"></span> <span class="point"></span> </div>
                    </a>
                    <div class="dropdown-menu mailbox dropdown-menu-right animated bounceInDown" aria-labelledby="2">
                        <ul>
                            <li>
                                <div class="drop-title">You have 4 new messages</div>
                            </li>
                            <li>
                                <div class="message-center">
                                    <!-- Message -->
                                    <a href="#">
                                        <div class="user-img"> <img src="{{ asset('/assets/images/users/1.jpg') }}" alt="user" class="img-circle"> <span class="profile-status online pull-right"></span> </div>
                                        <div class="mail-contnet">
                                            <h5>Pavan kumar</h5> <span class="mail-desc">Just see the my admin!</span> <span class="time">9:30 AM</span> </div>
                                    </a>
                                    <!-- Message -->
                                    <a href="#">
                                        <div class="user-img"> <img src="{{ asset('/assets/images/users/2.jpg') }}" alt="user" class="img-circle"> <span class="profile-status busy pull-right"></span> </div>
                                        <div class="mail-contnet">
                                            <h5>Sonu Nigam</h5> <span class="mail-desc">I've sung a song! See you at</span> <span class="time">9:10 AM</span> </div>
                                    </a>
                                    <!-- Message -->
                                    <a href="#">
                                        <div class="user-img"> <img src="{{ asset('/assets/images/users/3.jpg') }}" alt="user" class="img-circle"> <span class="profile-status away pull-right"></span> </div>
                                        <div class="mail-contnet">
                                            <h5>Arijit Sinh</h5> <span class="mail-desc">I am a singer!</span> <span class="time">9:08 AM</span> </div>
                                    </a>
                                    <!-- Message -->
                                    <a href="#">
                                        <div class="user-img"> <img src="{{ asset('/assets/images/users/4.jpg') }}" alt="user" class="img-circle"> <span class="profile-status offline pull-right"></span> </div>
                                        <div class="mail-contnet">
                                            <h5>Pavan kumar</h5> <span class="mail-desc">Just see the my admin!</span> <span class="time">9:02 AM</span> </div>
                                    </a>
                                </div>
                            </li>
                            <li>
                                <a class="nav-link text-center" href="javascript:void(0);"> <strong>See all e-Mails</strong> <i class="fa fa-angle-right"></i> </a>
                            </li>
                        </ul>
                    </div>
                </li> --}}
                <!-- ============================================================== -->
                <!-- End Messages -->
                <!-- ============================================================== -->
                <!-- ============================================================== -->
                <!-- Language -->
                <!-- ============================================================== -->
                <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle waves-effect waves-dark" href="{{ route('admin.profile') }}" target="main-body">
                    <el-badge class="item">
                          <el-button>个人中心</el-button>
                        </el-badge>
                    </a>
                </li>
                <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle waves-effect waves-dark" href="{{ route('admin.setPassword') }}" target="main-body"><el-badge class="item">
                          <el-button>修改密码</el-button>
                        </el-badge></a>
                </li>
                <!-- ============================================================== -->
                <!-- Profile -->
                <!-- ============================================================== -->
                <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle waves-effect waves-dark" href="" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><el-badge class="item">
                          <el-button>{{auth('admin')->user()->name }}--{{ !empty(auth('admin')->user()->getRoleNames()) ? auth('admin')->user()->getRoleNames()[0] : ''}}</el-button>
                        </el-badge></a>
                    <div class="dropdown-menu dropdown-menu-right animated flipInY">
                        <ul class="dropdown-user">
                            <li>
                                <div class="dw-user-box">
                                    <!-- <div class="u-img"><img src="{{ asset(auth('admin')->user()->avatar) }}" alt="user"></div> -->
                                    <div class="u-text">
                                        <h4>{{  auth('admin')->user()->name}}</h4>
                                        <p class="text-muted">手机号:{{  auth('admin')->user()->phone}}</p>
                                        {{-- <a href="pages-profile.html" class="btn btn-rounded btn-danger btn-sm">个人中心</a></div> --}}
                                </div>
                            </li>
                            {{-- <li role="separator" class="divider"></li>
                            <li><a href="#"><i class="ti-user"></i> My Profile</a></li>
                            <li><a href="#"><i class="ti-wallet"></i> My Balance</a></li>
                            <li><a href="#"><i class="ti-email"></i> Inbox</a></li> --}}   
                            
                            <li role="separator" class="divider"></li>
                            <li><a href="{{ route('admin.logout') }}"><i class="fa fa-power-off"></i> 退出</a></li>
                        </ul>
                    </div>
                </li>
            </ul>
        </div>
    </nav>
</header>